package liuyuyang.controller;

import liuyuyang.domain.Role;
import liuyuyang.pojo.Result;
import liuyuyang.service.RoleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Resource
    private RoleService roleService;

    @GetMapping
    public Result<List<Role>> list(){
        return Result.success(roleService.list());
    }
}
